package com.ibeeking.found.open.api.feign;

import com.ibeeking.found.common.entity.open.OpenAuthDTO;
import com.ibeeking.found.common.entity.open.OpenAuthQuery;
import com.ibeeking.found.open.api.feign.fallback.OpenFeignFallbackFactory;
import com.ibeeking.nematos.utils.result.ResponseResult;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;

import java.util.List;

/**
 * @Author ibeeking
 */
@FeignClient(name = "base-open-b-server", path = "/b", contextId = "openFeignClient", fallbackFactory = OpenFeignFallbackFactory.class, decode404 = true)
public interface OpenFeignClient {

    /**
     * 取得所有租户的开放平台授权权限列表
     * @return
     */
    @PostMapping(value = "/openAuth/feign/v1/queryOpenAuthList")
    ResponseResult<List<OpenAuthDTO>> queryOpenAuthList(@RequestBody OpenAuthQuery query);
    /**
     * 取得租户的开放平台授权列表
     * @param query
     * @return
     */
    @PostMapping(value = "/openAuth/feign/v1/queryOpenAuthOne")
    ResponseResult<OpenAuthDTO> queryOpenAuthOne(@RequestBody OpenAuthQuery query);
}
